package com.hengpeng.itfinbase.persist;

import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Enumerated;
import javax.persistence.Table;

import com.hengpeng.common.persist.entity.AuditedEntity;
import com.hengpeng.common.web.annotation.HtmlInput;
import com.hengpeng.common.web.annotation.HtmlInputPattern;
import com.hengpeng.common.web.annotation.HtmlInputType;
import com.hengpeng.itfinbase.idAssign.AbstractAssign18IdEntity;

/**
 * <pre>
 * 用户留言
 * </pre>
 * @author zhaojitao
 * @version 1.0, 2015-5-14
 */
@Entity
@Table(name = "CommentTB")
public class Comment extends AbstractAssign18IdEntity implements AuditedEntity
{
	/**
	 * <pre>
	 *  留言类型
	 * </pre>
	 * @version 1.0, 2010-9-21
	 */
	public enum CommentType
	{
		PRODUCT("产品相关"), CONTENT("内容相关"), SERVICE("服务相关"), OTHER("其它");

		private String text;

		CommentType(String text)
		{
			this.text = text;
		}

		public String getText()
		{
			return text;
		}

		public void setText(String text)
		{
			this.text = text;
		}
	}

	private static final long serialVersionUID = -5166155105773639041L;

	@HtmlInput(label = "是否通过审核", type = HtmlInputType.HIDDEN, index = 3, nullable = true, labelProperty = "text")
	@Column(length = 10)
	@Enumerated(javax.persistence.EnumType.STRING)
	private BoolValue auditState;

	@HtmlInput(label = "留言类型", type = HtmlInputType.HIDDEN, index = 8, nullable = true, labelProperty = "text")
	@Enumerated(javax.persistence.EnumType.STRING)
	private CommentType commentType;

	@HtmlInput(label = "留言人", type = HtmlInputType.HIDDEN, index = 6, nullable = true)
	private String commUserName;

	/**
	 * 联系方式
	 */
	private String contact;

	@Column(length = 1000)
	@HtmlInput(label = "内容", maxLength = 1000, type = HtmlInputType.TEXTAREA, index = 2, nullable = false)
	private String content;

	/**
	 * 表情标记
	 */
	@Column(length = 20)
	private String expression;

	/**
	 * 留言人IP
	 */
	@Column(length = 50)
	private String ip;

	@HtmlInput(label = "是否屏蔽", type = HtmlInputType.HIDDEN, index = 8, nullable = true, labelProperty = "text")
	@Enumerated(javax.persistence.EnumType.STRING)
	private BoolValue isHidden;

	@HtmlInput(label = "是否公开", type = HtmlInputType.HIDDEN, index = 8, nullable = true, labelProperty = "text")
	@Enumerated(javax.persistence.EnumType.STRING)
	private BoolValue isPublic;

	@HtmlInput(label = "留言时间", type = HtmlInputType.TEXT, pattern = HtmlInputPattern.DATETIME, format = "yyyy-MM-dd HH:mm", index = 12, nullable = false)
	private Date postTime;

	@HtmlInput(label = "回复内容", type = HtmlInputType.HIDDEN, index = 4, nullable = true)
	@Column(length = 1000)
	private String reply;

	@HtmlInput(label = "回复状态", type = HtmlInputType.HIDDEN, index = 5, nullable = true, labelProperty = "text")
	@Column(length = 10)
	@Enumerated(javax.persistence.EnumType.STRING)
	private BoolValue replyState;

	@HtmlInput(label = "回复人", type = HtmlInputType.HIDDEN, index = 7, nullable = true)
	private String replyUserName;

	@HtmlInput(label = "标题", type = HtmlInputType.TEXT, index = 1, nullable = false)
	@Column(length = 50, nullable = false)
	private String title;

	public BoolValue getAuditState()
	{
		return auditState;
	}

	public CommentType getCommentType()
	{
		return commentType;
	}

	public String getCommUserName()
	{
		return commUserName;
	}

	public String getContact()
	{
		return contact;
	}

	public String getContent()
	{
		return content;
	}

	public String getExpression()
	{
		return expression;
	}

	public String getIp()
	{
		return ip;
	}

	public BoolValue getIsHidden()
	{
		return isHidden;
	}

	public BoolValue getIsPublic()
	{
		return isPublic;
	}

	public Date getPostTime()
	{
		return postTime;
	}

	public String getReply()
	{
		return reply;
	}

	public BoolValue getReplyState()
	{
		return replyState;
	}

	public String getReplyUserName()
	{
		return replyUserName;
	}

	public String getTitle()
	{
		return title;
	}

	public void setAuditState(BoolValue auditState)
	{
		this.auditState = auditState;
	}

	public void setCommentType(CommentType commentType)
	{
		this.commentType = commentType;
	}

	public void setCommUserName(String commUserName)
	{
		this.commUserName = commUserName;
	}

	public void setContact(String contact)
	{
		this.contact = contact;
	}

	public void setContent(String content)
	{
		this.content = content;
	}

	public void setExpression(String expression)
	{
		this.expression = expression;
	}

	public void setIp(String ip)
	{
		this.ip = ip;
	}

	public void setIsHidden(BoolValue isHidden)
	{
		this.isHidden = isHidden;
	}

	public void setIsPublic(BoolValue isPublic)
	{
		this.isPublic = isPublic;
	}

	public void setPostTime(Date postTime)
	{
		this.postTime = postTime;
	}

	public void setReply(String reply)
	{
		this.reply = reply;
	}

	public void setReplyState(BoolValue replyState)
	{
		this.replyState = replyState;
	}

	public void setReplyUserName(String replyUserName)
	{
		this.replyUserName = replyUserName;
	}

	public void setTitle(String title)
	{
		this.title = title;
	}
}
